﻿using System;
using System.Net.Mail;

namespace BigfootWeb.Email
{
    /// <summary>
    /// This is the IEmailProvider concreate implemation for asp.net. It reads the smtp settings from the web.config
    /// </summary>
    public class ASPEmail : IEmailProvider
    {
        
        void IEmailProvider.SendEmail(MailMessage msg)
        {
            var client = new SmtpClient();
            client.Send(msg);
        }

        public void SendEmail(MailMessage msg, params string[] attachments)
        {
            foreach (var att in attachments)
            {
                msg.Attachments.Add(new Attachment(att));
            }
            SendEmail(msg);
        }
    }
}
